<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
  <head>
    <base href="<%=basePath%>">
    <title>标准管理</title>
       <link href="/assets/styles/default.css" rel="stylesheet" type="text/css" />
        <link rel="stylesheet" type="text/css" href="/assets/styles/themes/icon.css" />
        <link rel="stylesheet" type="text/css" href="/assets/styles/themes/default/easyui.css" />
		<link href="/components/zykt_nj/menu_nj/TestStandardManage/TestStandardManage.css" type="text/css" rel="stylesheet">

        <script type="text/javascript" src="/assets/scripts/jquery-2.1.1.min.js"></script>
        <script type="text/javascript" src="/assets/scripts/jquery.easyui.min2.js"></script>
        <script type="text/javascript" src="/assets/scripts/easyui-lang-zh_CN.js"></script>
        <script type="text/javascript" src="/assets/scripts/ajaxfileupload.js"></script>
        <script type="text/javascript" src="/components/zykt_nj/menu_nj/TestStandardManage/loadCookie.js"></script>
        <script type="text/javascript" src="/components/zykt_nj/menu_nj/TestStandardManage/TestStandardManage.js"></script>
        
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<script type="text/javascript">

	//权限按钮设置
	$(function(){
	    if(authority.indexOf("查询") < 0 ){
	       $('#tool_search').linkbutton('disable');
	    }
	    if(authority.indexOf("增加") < 0 ){
	       $('#tool_add').linkbutton('disable');
	    }
	    if(authority.indexOf("修改") < 0 ){
	       $("#tool_edit").linkbutton('disable');
	    }
	    if(authority.indexOf("删除") < 0 ){
	       $("#tool_del").linkbutton('disable');
	    }
	    
    });
</script>



  </head>
  
   <body style="background:#fff" >
    <div class="easyui-layout" style="height:540px;" style="overflow:hidden;">
    
<!-- center 存放内容-->
     <div data-options="region:'center',border:false" style="overflow:hidden;">
        <div style="width:1200px; margin: 0 auto;font-size:14px; font-family: Tahoma,Verdana,微软雅黑,新宋体;" style="overflow:hidden;">
          <!-- 存放自己的内容-->
          	<div>您的位置：标准管理>>
          		<a href="../../menu_nj/TestStandardManage/TestStandardManage">标准管理</a>
          	</div>
			
			
			<div class="easyui-layout" style="width:1200px;height:650px">
				<!-- 查询窗口 -->
				<div data-options="region:'north',collapsed:false " style="height:67px;width:1200px" title="搜索栏">
					<table style="border:1px ;margin:0 auto">
						
						<tr>
							<th>标准类别</th>
							<td>
								<select class="easyui-combobox" id="std_type" name="std_type"  editable='false'>
									<option selected ></option>
									<option>通用</option>
		                   			<option>国家标准</option>
		                   			<option>国际标准</option>
		                   			<option>海尔标准</option>
		                   			<option>模拟规范</option>
		                   			<option>自定义规范</option>
			                   	</select>
							</td>
							<th>产品类别</th>
							<td>
								<input class="easyui-combobox" id="pd_type" name="pd_type" method="get" data-options="valueField:'id',textField:'categoryname',url:'../../api/cgetAllProductCategory'" >
								
							</td>						
						<!--</tr>
						<tr>-->
							<th>标准名称</th>
							<td><input class="easyui-validatebox" id="std_name" name="std_name"></td>
							<th>标准编码</th>
							<td><input class="easyui-validatebox" id="std_code" name="std_code"></td>
							<td>
								<a id="tool_search" href="javascript:void(0)" class="easyui-linkbutton" onclick="searchByConditions()" data-options="iconCls:'icon-ktsySearch'" >查找</a>
							</td>
						</tr>
						
						
					</table>
					
				</div>
				<div data-options="region:'center',split:false,border:false" style="width:100%;height:100%">
		            <table id="dg"> </table>
	        	</div>
			</div>

	        
			
			<!-- 修改窗口 -->
			<div id="edit" class="easyui-dialog" title="修改" data-options="collapsible:false,minimizable:false,maximizable:false,closed:true,iconCls:'icon-save'" style="width:800px;height:420px;padding:10px;overflow:hidden;">
			<br>
				<form id="ef" enctype="multipart/form-data" method="post"> 
					<table class="bordered"  width="400px">
						<tr style="display: none">
						<!-- <tr> -->
							<th>id</th>
							<td><input calss="easyui-validatebox" id="template_id" name="template_id"></td>
							<td>
		                		<input class="easyui-textbox" id="update_emp_id" name="update_emp_id" data-options="editable:false">
		                	</td>
		                	<td>
								<input class="easyui-textbox" id="isrt_emp_id" name="isrt_emp_id" data-options="editable:false">
		                	</td>
		                	<td>
		                		<input class="easyui-textbox" id="part_type_name" name="part_type_name"  data-options="editable:false">
		                	</td>
						</tr>
		                <tr>
		                	<th>标准编码</th>
		                	<td>
		                    	<input class="easyui-validatebox" id="template_code" name="template_code" required="true" missingMessage="此项为必填选项">
		                  	</td>
		                	<th>标准名称</th>
		                	<td>
		                    	<input class="easyui-validatebox" id="template_name" name="template_name" required="true" missingMessage="此项为必填选项">
		                  	</td>		                  	
		                </tr>
		                <tr>		                	
		                  	<th>适用范围</th>
		                  	<td><input class="easyui-textbox" data-options="multiline:true"  id="template_use_area" name="template_use_area" required="true" missingMessage="此项为必填选项" style="width:300px;height:80px"></td>
		                  	<th>标准类别</th>
		                  	<td>
		                   		<select class="easyui-combobox" id="template_type" name="template_type"  editable='false'>
									<option selected>通用</option>
		                   			<option>国家标准</option>
		                   			<option>国际标准</option>
		                   			<option>海尔标准</option>
		                   			<option>模拟规范</option>
		                   			<option>自定义规范</option>
		                   		</select>
		                  	</td>
		                </tr>
		               
		                <tr>
		                	<th>所属产品类别</th>
			                <td>
			                    
			                    <input class="easyui-combobox" id="part_type_id" name="part_type_id" method="get" data-options="valueField:'id',textField:'categoryname',url:'../../api/cgetAllProductCategory',

									onSelect: function(){	
									$('#part_type_name').textbox('setValue',$('#part_type_id').combobox('getText'));
									$('#part_type_name').textbox('setText',$('#part_type_id').combobox('getText'));
								}" >
			                 
			                </td>
			                <th>测试类别</th>
		                  	<td>		                    
		                    	
		                    	<select class="easyui-combobox" id="fixscope" name="fixscope"  editable='false'>
		                   			<option selected>性能</option>
		                   			<option>安全</option>
		                   			<option>噪音</option>
		                   			<option>运输</option>
		                   			<option>EMC</option>
									<option>可靠性</option>
									<option>环境</option>
									<option>舒适性</option>
									<option>模拟</option>
									<option>应力</option>
									<option>压缩机性能</option>
	                                <option>换热器</option>
	                                <option>联合实验</option>
		                   		</select>
		                  	</td>
		                </tr>
		                <tr>
		                	<th>关联文档</th>
		                  	<td>
		                  		<!-- <input class="easyui-filebox" id="relateddocument" name="relateddocument" data-options="buttonText:'上传',editable:'false'"/> -->
								<input id="relateddocument" name="relateddocument" type="text" style="display:none"/>
		                  		<input type="file" id="houseMaps" name="houseMaps"/>
            					<input type="button" value="上传" onclick="fileupload()">
		                  	</td>
		                  	<!-- <td><input type="text" id="relateddocument" name="document" ></td> -->
		                  	<th>说明</th>
		                  	<td><input class="easyui-textbox"  id="remarks" name="remarks" width=500 height=200></td>	
		                </tr>
		                <tr>
		                	<th>截止日期</th>
		                	<td><input class="easyui-datebox" id="validdeadline" id="validdeadline" name="validdeadline" data-options="formatter:myformatter,parser:myparser" editable='false'></td>
		                	<th>状态</th>
		                	<td>
		                		<select class="easyui-combobox" id="state" name="state"  editable='false'>
		                   			<option selected value=1>有效</option>
		                   			<option value=0>无效</option>
		                   		</select>
		                	</td>
		                </tr>
		                 <tr>
							<th>最后修改人</th>
		                  	<td><input class="easyui-textbox" id="update_emp_name" name="update_emp_name" data-options="editable:false"></td>
							<th>添加人</th>
		                  	<td>
		                  		<input class="easyui-textbox" id="isrt_emp_name" name="isrt_emp_name" data-options="editable:false">
		                  	</td>
		                </tr>
		            </table>
						<div style="height:10px"></div>
		              <center >
			                <input id="saveButton" name="saveButton" class="easyui-linkbutton" type="button" value="提交"  style="height:30px"/>
			              	<input id="cancelButton" name="cancelButton" class="easyui-linkbutton" type="button" onclick="javascript:$('#edit').window.('close');" value="取消" style="height:30px">			              	
		              </center>
					<br>
				</form>
			</div>
			<div id="importExcel" class="easyui-dialog" title="上传" data-options="collapsible:false,minimizable:false,maximizable:false,closed:true,iconCls:'icon-save'" style="width:400px;height:100px;padding:10px;overflow:hidden;">
				<form action="/importExcel" method="post" enctype="multipart/form-data" align="center">
		          <input  class="easyui-linkbutton" type="file" id="imprtFile" value="选择Excel模板" name="imprtFile"/>  
		          <input class="easyui-linkbutton" type="button" value="上传" style="width:50px" onclick="importExcel()"><span style="width:100px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>

		           
		            <!-- <input type="button" value="下载" onclick="downloadFile()"> -->
		            <a href="/downLoadFileFromFtp?url=/ktsyfile/2017/04/05/7c9e627a-7a07-4e38-9f49-71b494b8787c.xlsx">下载模版</a>
          			
		      	</form>
			</div>

			<script type="text/javascript">
				function importExcel(){
           			console.log(realname);
           			var file1 = document.getElementById("imprtFile").value;
           			if(file1 !=null && file1 != "" && file1 != undefined){
           				$.ajaxFileUpload(
		                    {
		                        url:'/importExcel?flag=tst&realname='+realname,            //需要链接到服务器地址
		                        secureuri:false,
		                        fileElementId:'imprtFile',                        //文件选择框的id属性
		                        dataType: 'json',                                     //服务器返回的格式，可以是json
		                        success: function (data, status){
		                          // datagrid0.datagrid('reload');
		                            alert("导入成功");
		                            datagrid.datagrid('reload');

		                        },
		                        error: function(data, status, e){
		                            alert("上传失败!");
		                        }
		                    }
		                  
		            	);
           			}else{
           				$.messager.alert('错误',"请选择上传文件！","error");
           			}		            
		           
		        }
			</script>

          <!-- center 存放内容-->
       </div>
     </div>
<!-- footer -->
  
</div>
</body>
</html>
